package me.ycy.android.helper;

import android.content.ContentValues;

public class ContentValuesWrapper {
    ContentValues cv;

    public ContentValues android() {
        return cv;
    }

    public ContentValuesWrapper() {
        cv = new ContentValues();
    }

    public void putByte(String key, Byte value) {
        cv.put(key, value);
    }

    public void putInteger(String key, Integer value) {
        cv.put(key, value);
    }

    public void putFloat(String key, Float value) {
        cv.put(key, value);
    }

    public void putShort(String key, Short value) {
        cv.put(key, value);
    }

    public void putByteArray(String key, byte[] value) {
        cv.put(key, value);
    }


    public void putString(String key, String value) {
        cv.put(key, value);
    }


    public void putDouble(String key, Double value) {
        cv.put(key, value);
    }


    public void putLong(String key, Long value) {
        cv.put(key, value);
    }

    public void putLongOrNull(String key, Long value) {
        if (value == 0) {
            putNull(key);
        }
        else {
            putLong(key, value);
        }
    }

    public void putBoolean(String key, Boolean value) {
        cv.put(key, value);
    }

    public void putNull(String key) {
        cv.putNull(key);
    }
}
